﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DALLayer.Base;

namespace BusinessLogicLayer.Base
{
    /// <summary>
    /// Manager Base Class
    /// </summary>
    /// <typeparam name="P">the data provider type</typeparam>
    public abstract class ManagerBase<P> where P : DataAccessBase
    {
        #region [Constructor]
        /// <summary>
        /// Initializes a new instance of the <see cref="ManagerBase{P}" /> class.
        /// </summary>
        public ManagerBase()
        {
            this.InitializeDataProvider();
        } 
        #endregion

        #region [Protected Properties]
        /// <summary>
        /// Gets or sets the data provider.
        /// </summary>
        /// <value>
        /// The data provider.
        /// </value>
        protected P DataProvider { get; set; } 
        #endregion

        #region [Protected Methods]
        //The method used by the child to Initialize the data provider
        protected abstract void InitializeDataProvider(); 
        #endregion
    }
}
